from redis import StrictRedis

class Config:
    DEBUG = None
    SECRET_KEY = 'O4bzGA1cGw7qE1A62Pd8Z8t/K8DAV05UcvNAkAX6HD7Xa4Q25tT6LvmOBQ2zWpwqfZo6VfeIPG1/vqQyIjaWRwPQ'

    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info32'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE_SIGNER = True
    PERMANENT_SESSION_LIFETIME = 86400

class DevelopmentConfig(Config):
    DEBUG = True

class ProductionConfig(Config):
    DEBUG = False

# 定义字典来映射不同配置类
config_dict = {
    'development':DevelopmentConfig,
    'production':ProductionConfig
}